package top.chukongxiang.dubboboot.simple.common.utils;

import java.util.Collection;

/**
 * @author 楚孔响
 * @version 1.0
 * @date 2020/12/8 11:50
 **/
public class MathUtils {

    public static int sumInt(Integer... integers){
        int sum = 0;
        for (Integer integer : integers) {
            sum += integer;
        }
        return sum;
    }

    public static int sumInt(Collection<Integer> collection) {
        int sum = 0;
        for (Integer integer : collection) {
            sum += integer;
        }
        return sum;
    }

    public static long sumLong(Long... longs){
        long sum = 0;
        for (Long lo : longs) {
            sum += lo;
        }
        return sum;
    }

    public static long sumLong(Collection<Long> collection) {
        long sum = 0;
        for (Long aLong : collection) {
            sum += aLong;
        }
        return sum;
    }



}
